<template>
	<view>
		<v-leaflet ref="gdleafletwx"></v-leaflet>
	</view>
</template>

<script>
    const plugin = requirePlugin('zhgeo-plugin')
	
	export default {
		data() {
			return {
				
			}
		},
		onLoad() {
			// const container = this.selectComponent('#gd-leafletwx')
			const container = this.$refs.gdleafletwx
			let min_zoom = 10
			let max_zoom = 18
			container.initLeafletMap(function(L) {
              wx.leaflet ??= {}
              wx.leaflet.L = L;
                var map = L.map(container, {
                    minZoom: min_zoom,
                    maxZoom: max_zoom});
                L.tileLayer('http://webrd0{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}', { subdomains: "1234" }).addTo(map),
                map.setView([31.294516,120.625814], 18);
                // 添加marker
                let m = L.marker([31.2948516,120.625814], {
                    src: 'https://cdn.bootcdn.net/ajax/libs/leaflet/1.9.4/images/marker-icon-2x.png',
                    width: 32,
                    height: 32,
                    showInCenter: false,
                }).addTo(map);
                // 删除marer
                // map.removeLayer( m );
			});
		},
		methods: {
			
		}
	}
</script>

<style>

</style>
